<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>小礼子管理平台</title>
<#include "/WEB-INF/content/include-public.html">
<#include "/WEB-INF/content/include-easyui.html">

<script type="text/javascript" src="${request.contextPath}/res/core/jquery.form.js"></script>
<link rel="shortcut icon" href="favicon.ico" />
<link href="${request.contextPath}/css/login.css" rel="stylesheet" type="text/css" />

<style type="text/css">
body {
	background-image: url(${request.contextPath}/images/login/bg.png);
	background-color:#3399cc;
	background-position: center top;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
	color: #666666;
	font-family: Arial, Helvetica, sans-serif;
	background-repeat: no-repeat;
}
</style>


<script type="text/javascript" src="${request.contextPath}/res/core/sha256.js"></script>
<script type="text/javascript">
	$(function() {
		$("#kaptcha").click(function() {
			$(this).attr( "src", "${request.contextPath}/Kaptcha?number=" + Math.floor(Math.random() * 100));
		});
		$("#loginButton").click(function() {
			if($("#account").val()==""){
				$.messager.show({title:"系统提示",msg:"请输入用户名"});return false;}
			if($("#pwd").val()==""){
				$.messager.show({title:"系统提示",msg:"请输入密码"});return false;}
			if($("#code").val()==""){
				$.messager.show({title:"系统提示",msg:"请输入验证码"});return false;}
			$("#pwd2").val(SHA256($("#pwd").val()));
			$("#login").ajaxSubmit({
				url :  "${request.contextPath}/login",
				success : function(data) {
					if (data.result.state) {
						location.href = "${request.contextPath}/center";
					} else {
						$.messager.show({
							title : "系统提示",
							msg : data.result.msg
						});
					}
				}
			});
		});
		$("#account").keydown(function(event) {
			switch (event.keyCode) {
			case 13:
				$("#pwd").focus();
				break;
			default:
				break;
			}
		});
		$("#pwd").keydown(function(event) {
			switch (event.keyCode) {
			case 13:
				$("#code").focus();
				break;
			default:
				break;
			}
		});
		$("#code").keydown(function(event) {
			switch (event.keyCode) {
			case 13:
				$("#loginButton").click();
				break;
			default:
				break;
			}
		});

	});
</script>
</head>

<body>
	<div id="bg">
		<div id="top"></div>
		<div id="Content">
			<div id="sign">
				<form id="login" method="post">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="55" height="30">用户名</td>
							<td width="162" height="30"><input id="account" placeholder="请输入用户名" style="border:0;" name="account" type="text" value="" /></td>
						</tr>
						<tr>
							<td width="55" height="80">密&nbsp;&nbsp;&nbsp;&nbsp;码</td>
							<td width="162" height="80"><input id="pwd2" name="pwd" type="hidden"/><input id="pwd" style="border:0;" placeholder="请输入密码" type="password" value=""/></td>
						</tr>
						<tr>
							<td width="55" height="5">验证码</td>
							<td width="162" height="5" valign="middle"><input id="code" placeholder="请输入验证码" name="code" style="border:0;width:94px" type="text" id="code" /><img id="kaptcha" title="点击刷新验证码" src="${request.contextPath}/Kaptcha" align="absmiddle" style="cursor: pointer; margin-left: 3px;" /></td>
						</tr>
						<tr style="margin-top:30px;">
							<td align="center" colspan="2" height="80">
								<a id="loginButton"style="cursor: pointer;background-color:#fcc143;height:20px;padding-left:90px;padding-right:90px;font-size:1.2rem;"><font style="color:white;">登&nbsp;&nbsp;&nbsp;&nbsp;录</font></a>
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
</body>
</html>